<template>
    <div class="orders-block">
        <h2>订单列表</h2>
        <el-table :data="orders" style="width: 100%" v-loading="loading">
            <el-table-column prop="orderId" label="订单号" width="auto" />
            <el-table-column prop="goods" label="商品名称" width="auto" />
            <el-table-column prop="amount" label="数量" width="auto" />
            <el-table-column prop="total" label="总价" width="auto" />
        </el-table>
    </div>
</template>

<script setup>
const props = defineProps({
    orders: {
        type: Array,
        default: () => []
    },
    loading: {
        type: Boolean,
        default: false
    }
})
</script>

<style lang="less" scoped>
.orders-block {
    min-width: 350px;
    max-width: 100%;
    margin-bottom: 24px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

    h2 {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 18px;
        color: #333;
    }

    .el-table {
        background: #fafbfc;
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    }
}
</style>
